Skip to content

fix(api): leave out unset extra settings when reading them - #3949

Merged
Chartman123 merged 1 commit into
mainfrom
fix/extra-settings-null-on-read
Nov 21, 2026
Merged

Chartman123 merged 1 commit into
mainfrom
fix/extra-settings-null-on-read

Conversation

@AndyScherzinger

Copy link
Copy Markdown
Member

Extra settings that are set back to their default, for example the lowest value of a linear scale, are stored as null, and the API returned these nulls, although the documented FormsQuestionExtraSettings type does not allow them. Question::getExtraSettings() now leaves out unset values (null and false) when reading, which also covers questions saved earlier.

Found in the review of #3637, which leaves null out on write; this fixes the read side on main.

How to verify

  1. Set a linear scale's lowest value back to 1 (the frontend stores optionsLowest: null), or PATCH a question with {"extraSettings": {"optionsLowest": null, "optionsHighest": 7}}.
  2. GET the question: extraSettings is {"optionsHighest": 7}. Before, it held "optionsLowest": null.

Checked live on NC 36: the row still stores null, the API leaves it out. Unit test added in QuestionTest.

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

Extra settings that are set back to their default, for example the
lowest value of a linear scale, are stored as null, and the API
returned these nulls, which its documented types do not allow. Unset
values, null or false, are now left out when the extra settings are
read, so this also covers questions saved earlier.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
@codecov

codecov Bot commented Nov 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@AndyScherzinger AndyScherzinger added bug Something isn't working 3. to review Waiting for reviews labels Nov 21, 2026
@AndyScherzinger AndyScherzinger added this to the 5.5 milestone Nov 21, 2026
@Chartman123

Copy link
Copy Markdown
Collaborator

/backport to stable5.4

@backportbot backportbot Bot added the backport-request Pending backport by the backport-bot label Nov 21, 2026
@Chartman123
Chartman123 merged commit 99796bf into main Nov 21, 2026
52 checks passed
@Chartman123
Chartman123 deleted the fix/extra-settings-null-on-read branch November 21, 2026 08:14
@backportbot backportbot Bot removed the backport-request Pending backport by the backport-bot label Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews AI assisted bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants